var loadingFn = function () {
    var ary = [
        'bg.webp',
        'bg2.webp',
        'bg3.webp',
        'circle.webp',
        'detail-border.webp',
        'invitation.png',
        'item.png',
        'leaf.webp',
        'letterBot.webp',
        'letterTop.webp',
        'qr-code.jpg',
        'rope.webp',
        'rotate.webp',
        'teacher.jpg',
        'tip.png',
        'wheel-circle.webp',
        'wheel-star.webp'
        ];
    var $processBar = $(".progress-bar");
    var $loading = $(".loading");
    var num = 0, timer = null;
    $.each(ary, function (index, item) {
            var oImg = new Image();
            oImg.src = "img/" + item;
            oImg.onload = load;
    });
    function load() {
        num++;
        $processBar.css("width", num / ary.length * 100 + "%");
        if (num == ary.length){
            $loading.remove();
            indexFn.init();
        }
    }
}
window.onload = function(){
    loadingFn();
}
var indexFn = (function(){
    function init(){
        var mySwiper = new Swiper("#swiper", {
            direction: "vertical",
            loop: false,
            effect: "slide",
        });

    }
    return {init: init};
})()















